package com.itheima.demo.demo07;

import java.util.Objects;

public class Student01 {
    private String name;
    private int banji;
    private  String dizhi;

    public Student01() {

    }

    public Student01(String name, int banji, String dizhi) {
        this.name = name;
        this.banji = banji;
        this.dizhi = dizhi;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getBanji() {
        return banji;
    }

    public void setBanji(int banji) {
        this.banji = banji;
    }

    public String getDizhi() {
        return dizhi;
    }

    public void setDizhi(String dizhi) {
        this.dizhi = dizhi;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student01 student01 = (Student01) o;
        return banji == student01.banji &&
                Objects.equals(name, student01.name) &&
                Objects.equals(dizhi, student01.dizhi);
    }

    @Override
    public int hashCode() {

        return Objects.hash(name, banji, dizhi);
    }

    @Override
    public String toString() {
        return "Student01{" +
                "name='" + name + '\'' +
                ", banji=" + banji +
                ", dizhi='" + dizhi + '\'' +
                '}';
    }
}
